Optimal. Leaf size=47 \[ \frac {2 \sin (c+d x)}{3 a d}+\frac {i \cos (c+d x)}{3 d (a+i a \tan (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {3583, 2717}
\begin {gather*} \frac {2 \sin (c+d x)}{3 a d}+\frac {i \cos (c+d x)}{3 d (a+i a \tan (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2717
Rule 3583
Rubi steps
\begin {align*} \int \frac {\cos (c+d x)}{a+i a \tan (c+d x)} \, dx &=\frac {i \cos (c+d x)}{3 d (a+i a \tan (c+d x))}+\frac {2 \int \cos (c+d x) \, dx}{3 a}\\ &=\frac {2 \sin (c+d x)}{3 a d}+\frac {i \cos (c+d x)}{3 d (a+i a \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.15, size = 50, normalized size = 1.06 \begin {gather*} -\frac {\sec (c+d x) (-3+\cos (2 (c+d x))+2 i \sin (2 (c+d x)))}{6 a d (-i+\tan (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.35, size = 75, normalized size = 1.60
method | result | size |
risch | \(\frac {i {\mathrm e}^{-3 i \left (d x +c \right )}}{12 d a}+\frac {i \cos \left (d x +c \right )}{4 d a}+\frac {3 \sin \left (d x +c \right )}{4 d a}\) | \(49\) |
derivativedivides | \(\frac {-\frac {2}{3 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {i}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {3}{2 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {2}{4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+4 i}}{d a}\) | \(75\) |
default | \(\frac {-\frac {2}{3 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {i}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {3}{2 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}+\frac {2}{4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+4 i}}{d a}\) | \(75\) |
norman | \(\frac {\frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{3 a d}+\frac {2 \tan \left (d x +c \right )}{3 d a}+\frac {4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\tan ^{2}\left (d x +c \right )\right )}{3 a d}-\frac {2 i \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d a}-\frac {2 i \left (\tan ^{2}\left (d x +c \right )\right )}{3 d a}-\frac {2 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \tan \left (d x +c \right )}{3 d a}+\frac {2 i \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \tan \left (d x +c \right )}{3 d a}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (1+\tan ^{2}\left (d x +c \right )\right )}\) | \(172\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.34, size = 41, normalized size = 0.87 \begin {gather*} \frac {{\left (-3 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 6 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )} e^{\left (-3 i \, d x - 3 i \, c\right )}}{12 \, a d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 126 vs. \(2 (36) = 72\).
time = 0.15, size = 126, normalized size = 2.68 \begin {gather*} \begin {cases} \frac {\left (- 24 i a^{2} d^{2} e^{5 i c} e^{i d x} + 48 i a^{2} d^{2} e^{3 i c} e^{- i d x} + 8 i a^{2} d^{2} e^{i c} e^{- 3 i d x}\right ) e^{- 4 i c}}{96 a^{3} d^{3}} & \text {for}\: a^{3} d^{3} e^{4 i c} \neq 0 \\\frac {x \left (e^{4 i c} + 2 e^{2 i c} + 1\right ) e^{- 3 i c}}{4 a} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.49, size = 67, normalized size = 1.43 \begin {gather*} \frac {\frac {3}{a {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right )}} + \frac {9 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 7}{a {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}^{3}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.55, size = 78, normalized size = 1.66 \begin {gather*} \frac {\left (-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,3{}\mathrm {i}+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1{}\mathrm {i}\right )\,2{}\mathrm {i}}{3\,a\,d\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+1{}\mathrm {i}\right )\,{\left (1+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}\right )}^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________